package com.study;

import com.study.util.FileUtil;
import com.study.util.NameUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * TODO
 *
 * @author wanghuilong
 * @version 1.0
 * @date 2021/6/30 9:28 下午
 */
public class Test3 {


    public static void main(String[] args) {
        int num = 28;

        int addAmount = 2500;

        Double sum = 0d;
        Double base = 0d;

        Double rate = 0.05;

        for (int i = 0; i < num; i++) {
            sum += addAmount;
            base += addAmount;
            sum = sum + sum * rate;
        }
        System.out.println(sum);
        System.out.println(base);
        System.out.println((sum - base) / base);

        List<String> list = new ArrayList<>();
        String join = StringUtils.join(list, ",");
        System.out.println(join);
        System.out.println(null == join);
        System.out.println("" == join);
        System.out.println(join.equals(""));

        Date now = new Date();
        List<String> strings = FileUtil.readTxtFileIntoStringArrList("/Users/wanghuilong/IdeaProjects/lazy/src/main/resources/file/3.txt", null);
        List<String> fields = new ArrayList<>();
        for (int i = 0; i < strings.size(); i++) {
            String s = strings.get(i).trim();
            s = s.replace(",", "").split(" ")[0];
            String[] split = s.split("\\.");
            String str = split[1];
            fields.add(NameUtils.getInstance().getJavaName(str));
            System.out.println(s + " " + NameUtils.getInstance().getJavaName(str) + ",");
        }
        System.out.println();
        for (int i = 0; i < fields.size(); i++) {
            String s = fields.get(i);
            System.out.println("private String " + s + ";");
            System.out.println();
        }

    }

    static class User {
        public String name;

        public User(String name) {
            this.name = name;
        }
    }
}
